package com.zzyl.mapper;

import com.zzyl.base.ResponseResult;
import com.zzyl.dto.BedDto;
import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);


    void newBed(Bed bed);

    @Select("select * from zzyl.bed where id = #{id};")
    BedVo selectBed(Long id);

    void upDateBed(Bed bed);
    @Delete("delete  from zzyl.bed where id = #{id}")
    void deleteBed(Long id);


//    @Insert("INSERT INTO bed (bed_number, bed_status, sort, room_id, create_time, update_time, create_by, update_by, remark) " +
//            "VALUES (#{bedNumber}, #{bedStatus}, #{sort}, #{roomId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{remark})")
//    @Options(useGeneratedKeys = true, keyProperty = "id")
//    int insertBed(Bed bed);
//
//    @Update("UPDATE bed " +
//            "SET bed_number = #{bedNumber}, bed_status = #{bedStatus}, sort = #{sort}, room_id = #{roomId}, " +
//            "update_time = #{updateTime}, create_by = #{createBy}, update_by = #{updateBy}, remark = #{remark} " +
//            "WHERE id = #{id}")
//    int updateBed(Bed bed);
//
//    @Select("SELECT * FROM bed WHERE id = #{id}")
//    Bed selectBedById(Long id);
//
//    @Delete("DELETE FROM bed WHERE id = #{id}")
//    int deleteBed(Long id);


}

